/*
 * @# Gallery.java 2011-12-26 下午04:09:04
 * 
 * Copyright (C) 2010 - 2011 广州羿安信息科技有限公司
 * Guangzhou ianswer information technology co. ltd.
 * 
 * All rights reserved!
 */
package com.ianswer.px.album.entity;

import javax.validation.constraints.NotNull;

import com.ianswer.common.util.IpAddressUtils;

/**
 * 画廊(相册分类).
 * 
 * @author alvin hwang
 */
public class Gallery {
	
	// 秀场
	private static final String SHOW_TYPE = "show";
	// 名品展示
	private static final String DRESS_TYPE = "dress";
	
	private Long id;
	
	@NotNull
	private Long userId;
	@NotNull
	private String name;
	private String type;
	private int albums;
	private Long createdAt;
	@NotNull
	private Long ipAddr;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAlbums() {
		return albums;
	}

	public void setAlbums(int albums) {
		this.albums = albums;
	}

	public Long getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Long createdAt) {
		this.createdAt = createdAt;
	}

	public Long getIpAddr() {
		return ipAddr;
	}

	public String getIpAddrStr() {
		return IpAddressUtils.recoverFromLong(ipAddr);
	}

	public void setIpAddr(Long ipAddr) {
		this.ipAddr = ipAddr;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Gallery showType() {
		setType(SHOW_TYPE);
		return this;
	}
	
	public Gallery dressType() {
		setType(DRESS_TYPE);
		return this;
	}
	
	public boolean isShowType() {
		return SHOW_TYPE.equals(type);
	}
	
	public boolean isDressType() {
		return DRESS_TYPE.equals(type);
	}
}
